# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: site-packages\win32\lib\win32traceutil.py
import win32trace


def RunAsCollector():
    import sys

    try:
        import win32api

        win32api.SetConsoleTitle("Python Trace Collector")
    except:
        pass

    win32trace.InitRead()
    print("Collecting Python Trace Output...")
    try:
        while True:
            sys.stdout.write(win32trace.blockingread(500))

    except KeyboardInterrupt:
        print("Ctrl+C")


def SetupForPrint():
    win32trace.InitWrite()
    try:
        print("Redirecting output to win32trace remote collector")
    except:
        pass

    win32trace.setprint()


if __name__ == "__main__":
    RunAsCollector()
else:
    SetupForPrint()
